package com.cn.ycy.proxy.cglib.cglibdemo;

class AProxy {

  public Object invoke(int index, Object o, Object[] ol) {
    A target = (A) o;
    switch (index) {
      case 1:
        target.f();
        return null;
      case 2:
        target.g();
        return null;
    }
    return null;
  }

  //这个方法对A类中的方法建立索引
  public int getIndex(String signature) {
    switch (signature.hashCode()) {
      case 3078479:
        return 1;
      case 3108270:
        return 2;
    }
    return -1;
  }
}
